package common.entities.enums;

/**
 * @author Yoyo
 *
 */
public enum SEX {
	
	MALE("Male", 1), 
	FEMALE("Female", 0);

	private String text;
	private int value;	//this is the value that will be in the DB attribute of sex

	/**
	 * @param text
	 */
	SEX(String text, int value){
		this.text = text;
		this.value = value;
	}
	
	public int getValue() {
		return value;
	}
	
	public String toString(){
		return this.text;
	}
	
	public static SEX parseStringToSEX(String sexStr){
		for(SEX sex : SEX.values()){
			if(sex.toString().toLowerCase().equals(sexStr.toLowerCase()))
				return sex;
		}
		
		return null;
	}
		
}
